package zzg.study.client.console;

import io.netty.channel.Channel;
import zzg.study.protocol.request.GroupMessageRequestPacket;

import java.util.Scanner;

/**
 * @Classname SendToGroupConsoleCommand
 * @Description 群聊指令
 * @Date 2023/12/10 1:06
 * @Author zhuzhenguo
 */
public class SendToGroupConsoleCommand implements ConsoleCommand {
    @Override
    public void exec(Scanner scanner, Channel channel) {
        System.out.print("发送消息给某个某个群组：");

        String toGroupId = scanner.next();
        String message = scanner.next();
        channel.writeAndFlush(new GroupMessageRequestPacket(toGroupId, message));

    }
}
